import Vue from 'vue'
import Router from 'vue-router'

//ReleaseMg发布管理
import ReleaseMg1 from '@/pages/ReleaseMg/ReleaseMg1'

//service三方服务
import BooksRepurchase from '@/pages/ServiceMg/BooksRepurchase'
import DressesLease from '@/pages/ServiceMg/DressesLease'

//userMg用户管理
import UserMg1 from '@/pages/UserMg/UserMg1'

//configMg配置管理
import ConfigMg1 from '@/pages/ConfigMg/ConfigMg1'

//authority权限管理
import AuthorityMg1 from '@/pages/AuthorityMg/AuthorityMg1'

//authority权限管理
import QmwBMg1 from '@/pages/QmwBMg/QmwBMg1'

// Pages Result结果
import Success from '@/pages/Result/Success'
import Fail from '@/pages/Result/Fail'

// Pages Exception异常
import Error403 from '@/pages/Exception/403'
import Error404 from '@/pages/Exception/404'
import Error500 from '@/pages/Exception/500'

// Pages User用户
import Login from '@/pages/User/Login'
import Register from '@/pages/User/Register'
import Result from '@/pages/User/Result'

// Layout布局
import HeaderContentFooter from '@/pages/Layout/HeaderContentFooter'
import HeaderContentSider from '@/pages/Layout/HeaderContentSider'
import HeaderSiderContent from '@/pages/Layout/HeaderSiderContent'
import SiderHeaderContent from '@/pages/Layout/SiderHeaderContent'
import SiderHeaderContentRetract from '@/pages/Layout/SiderHeaderContentRetract'

Vue.use(Router)

export default new Router({
  mode:'history',
  base:'/frontend/dist/',
  scorllBehavior:() =>({
    y:0
  }),
  routes: [
    // Root入口登录页面
    {
      path: '/',
      redirect: {
        name: 'user-login'
      }
    },
    //如果找不到路由进入404页面
    {
      path: '*',
      component:Error404,
    },
    //Pages ReleaseMg
    {
      path:'/relesemg/releasemg1',
      name:'releasemg1',
      component:ReleaseMg1,
      meta:{
        title:'发布管理'
      }
    },
    //Pages Service三方服务
    {
      path:'/servicemg/booksrepurchase',
      name:'booksrepurchase',
      component:BooksRepurchase,
      meta:{
        title:'二手书回购'
      }
    },
    {
      path:'/servicemg/dressesLease',
      name:'dresseslease',
      component:DressesLease,
      meta:{
        title:'礼服租赁'
      }
    },
    //Pages UserMg用户管理
    {
      path:'/usermg/usermg1',
      name:'usermg1',
      component:UserMg1,
      meta:{
        title:'用户管理'
      }
    },
    //Pages ConfigMg配置管理
    {
      path:'/config/configmg1',
      name:'configmg1',
      component:ConfigMg1,
      meta:{
        title:'配置管理'
      }
    },
    //Pages AuthorityMg权限管理
    {
      path:'/authoritymg/authoritymg1',
      name:'authoritymg1',
      component:AuthorityMg1,
      meta:{
        title:'权限管理'
      }
    },
     //Pages qmwBMg千米网后台/云商城
     {
      path:'/qmwbmg/qmwbmg1',
      name:'qmwbmg1',
      component:QmwBMg1,
      meta:{
        title:'云商城'
      }
    },
    // Pages Result
    {
      path: '/result/su',
      name: 'success',
      component: Success,
      meta: {
        title: '成功'
      }
    },
    {
      path: '/result/fail',
      name: 'fail',
      component: Fail,
      meta: {
        title: '失败'
      }
    },
    // Pages Error
    {
      path: '/Error/403',
      name: 'error-403',
      component: Error403,
      meta: {
        title: '403'
      }
    },
    {
      path: '/Error/404',
      name: 'error-404',
      component: Error404,
      meta: {
        title: '404'
      }
    },
    {
      path: '/Error/500',
      name: 'error-500',
      component: Error500,
      meta: {
        title: '500'
      }
    },
    // Page User Account
    {
      path: '/user/login',
      name: 'user-login',
      component: Login,
      meta: {
        title: '登录'
      }
    },
    {
      path: '/user/register',
      name: 'user-register',
      component: Register,
      meta: {
        title: '注册'
      }
    },
    {
      path: '/user/register-result',
      name: 'user-result',
      component: Result,
      meta: {
        title: '注册结果'
      }
    },
    {
      path: '/layout/headercontentfooter',
      name: 'headercontentfooter',
      component: HeaderContentFooter,
      meta: {
        title: '上中下布局'
      }
    },
    {
      path: '/layout/headercontentsider',
      name: 'headercontentsider',
      component: HeaderContentSider,
      meta: {
        title: '顶部-侧边布局-通栏'
      }
    },
    {
      path: '/layout/headersidercontent',
      name: 'headersidercontent',
      component: HeaderSiderContent,
      meta: {
        title: '顶部-侧边布局'
      }
    },
    {
      path: '/layout/siderheadercontent',
      name: 'siderheadercontent',
      component: SiderHeaderContent,
      meta: {
        title: '伸缩侧边布局'
      }
    },
    {
      path: '/layout/siderheadercontentretract',
      name: 'siderheadercontentretract',
      component: SiderHeaderContentRetract,
      meta: {
        title: '伸缩侧边布局'
      }
    }
  ]
})
